<?php


namespace App\Models\MainDB;
use \Illuminate\Database\Eloquent\Model;

class WeekStarHistory extends Model
{
    protected $table = 'ln_week_star_history';     //数据库内完整表名

    protected $primaryKey = 'id';    //主键名
    public $timestamps = false;

    protected $fillable = [
        'id',                   //id
        'week_star_id',        //周星榜id
        'user_id',              //用户id
        'room_id',              //房间id
        'type',                 //1周星榜2富豪榜3房间榜
        'rank',                 //排名
        'add_time',
        'total',                //总量
    ];
    public function week_stars() {
        return $this->hasOne('App\Models\MainDB\WeekStar', 'id', 'week_star_id');
    }
    public  function  user_data(){
        return $this->hasOne('App\Models\MainDB\UserData','user_id','user_id');
    }
}
